<template>
    <div class="about">
        <h1>About</h1>
        <p>This is the About page of the Vue2 Tech Demo project.</p>
        <div class="md-div">
            <v-md-preview :text="text"></v-md-preview>
        </div>

    </div>
</template>

<script>
import axios from 'axios';


export default {
    name: 'About',
    data() {
        return {
            text: '# 123'
        }
    },
    created() {
        // this.loadTextFile()
        this.loadMd()
    },
    methods: {
        async loadTextFile() {
            try {
                // 路径相对于项目的根目录（public目录）
                const response = await axios.get('/example.md');
                this.text = response.data;
            } catch (error) {
                console.error('读取文件失败:', error);
            }
        },
        async loadMd() {
            const resp = await axios.get('https://uatinsured.mingya.com.cn/ai/apiCallLog/one/success/bySourceMark?sourceMark=191d0cd6cc5446d9939a6c4803d6b6d0')
            console.log(resp.data.data.response)
            this.text = resp.data.data.response

        }
    }
}
</script>

<style scoped>
.about {
    padding: 20px;
}

.about h1 {
    color: #42b983;
}

.md-div {
    display: flex;
    text-align: left;
}
</style>